<template>
    <div>
        <button @click="isShow = !isShow">显示/隐藏</button>
        <!-- 
            appear : 一上来执行一次
         -->
        <transition name="hello" appear>
            <h1 v-show="isShow">你好啊</h1>
        </transition>
    </div>
</template>

<script>
export default {
    name:'Test',
    data(){
        return {
            isShow : true,
        }
    },
    methods:{
        
    }
}
</script>

<style scoped>
    h1{
        background-color: orange;
    }

    .hello-enter-active{
        animation:atbian 0.5s;
    }

    .hello-leave-active{
        animation: atbian 0.5s reverse;
    }

    @keyframes atbian {
        from{
            transform: translateX(-100%);
        }
        to{
            transform: translateX(0px);
        }

    }
</style>